cmake_minimum_required(VERSION 3.5)
include (cross.cmake)

set(TARGET embustest)
#PROJECT(embustest)

SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -ggdb3")
#SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

# 5. 添加头文件路径
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# 6. 添加源文件
FILE(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
message(${CMAKE_CURRENT_SOURCE_DIR})
message(${SOURCE_FILES})
# 7. 添加链接库

LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib)
LINK_LIBRARIES(embus)
LINK_LIBRARIES(zmq)
LINK_LIBRARIES(emfact)


# 9. 设置环境变量，编译用到的源文件全部都要放到这里，否则编译能够通过，
#但是执行的时候会出现各种问题，比如"symbol lookup error xxxxx , undefined symbol"
SET(ALL_SRCS ${SOURCE_FILES})
message(${ALL_SRCS})

add_definitions("-Wall -g")

# 10.add executable file，添加要编译的可执行文件
ADD_EXECUTABLE(${TARGET} ${ALL_SRCS})
#ADD_EXECUTABLE(${PROJECT_NAME} ${ALL_SRCS})

